home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / unix / ch20 / 20fig10.wrl < prev    next >
Text File  |  1996-09-23  |  2KB  |  65 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Generic lighting for ambience
  8.         DirectionalLight {
  9.             intensity 0.2
  10.             ambientIntensity 1.0
  11.         },
  12.     # Light bulb
  13.         DEF BulbLight PointLight {
  14.             radius 16.0
  15.             color 1.0 0.0 0.0
  16.         },
  17.     # Light bulb shape
  18.         Shape {
  19.             appearance Appearance {
  20.                 material DEF BulbColor Material {
  21.                     emissiveColor 1.0 0.3 0.3
  22.                     diffuseColor  0.0 0.0 0.0
  23.                 }
  24.             }
  25.             geometry DEF Bulb Sphere { }
  26.         },
  27.     # Wall
  28.         Transform {
  29.             translation 0.0 0.0 -1.1
  30.             rotation 1.0 0.0 0.0 1.57
  31.             children Inline { url "mesh.wrl" }
  32.         },
  33.     # Animation clock
  34.         DEF Clock TimeSensor {
  35.             cycleInterval 4.0
  36.             loop TRUE
  37.         },
  38.     # Animation brightness and colors
  39.         DEF BulbIntensity ScalarInterpolator {
  40.             key [ 0.0, 0.5, 0.5, 1.0 ]
  41.             keyValue [ 1.0, 1.0, 0.0, 0.0 ]
  42.         },
  43.         DEF BulbDiffuse ColorInterpolator {
  44.             key [ 0.0, 0.5, 0.5, 1.0 ]
  45.             keyValue [
  46.                 0.0 0.0 0.0,  0.0 0.0 0.0,
  47.                 1.0 0.3 0.3,  1.0 0.3 0.3
  48.             ]
  49.         },
  50.         DEF BulbEmissive ColorInterpolator {
  51.             key [ 0.0, 0.5, 0.5, 1.0 ]
  52.             keyValue [
  53.                 1.0 0.3 0.3,  1.0 0.3 0.3,
  54.                 0.0 0.0 0.0,  0.0 0.0 0.0,
  55.             ]
  56.         }
  57.     ]
  58. }
  59. ROUTE Clock.fraction_changed      TO BulbIntensity.set_fraction
  60. ROUTE Clock.fraction_changed      TO BulbDiffuse.set_fraction
  61. ROUTE Clock.fraction_changed      TO BulbEmissive.set_fraction
  62. ROUTE BulbIntensity.value_changed TO BulbLight.set_intensity
  63. ROUTE BulbDiffuse.value_changed   TO BulbColor.set_diffuseColor
  64. ROUTE BulbEmissive.value_changed  TO BulbColor.set_emissiveColor
  65.